package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/6/1.
 */
@HttpInlet(Conn.INLET_API_MINE_MYINFO)
public class GetApiMineMyinfo extends BaseAsyGet<GetApiMineMyinfo.Info> {
    public String userid;
    public GetApiMineMyinfo(AsyCallBack<GetApiMineMyinfo.Info> asyCallBack) {
        super(asyCallBack);
    }


    protected Info parser(JSONObject jsonObject) {

        TOAST = jsonObject.optString("message");
        if (jsonObject.optInt("code") == 200) {

            Info info = new Info();
            JSONObject o = jsonObject.optJSONObject("data");

            Data d = new Data();
            d.id = o.optString("id");
            d.tel = o.optString("tel");
            d.my_code = o.optString("my_code");
            d.sex = o.optString("sex").equals("1") ? "男" : "女";
            d.real_name = o.optString("real_name");
            d.card_type = o.optString("card_type");
            d.card_num = o.optString("card_num");
            d.birthday = o.optString("birthday");
            d.always_city = o.optString("always_city");

            info.data = d;

            return info;
        }

        return null;
    }


    public static class Info {
        public Data data;
    }

    public static class Data {
        public String id;
        public String tel;
        public String my_code;

        public String sex, real_name, card_type, card_num, birthday,always_city;


    }

}
